package org.example.eee.mapper;

import org.apache.ibatis.annotations.*;
import org.example.eee.entity.Student;

import java.util.List;

@Mapper
public interface StudentMapper {
    @Insert("INSERT INTO student (id,name,sex,email) VALUES (#{id},#{name},#{sex}, #{email})")
    public void insert(Student student);

    @Update("UPDATE student SET name=#{name}, sex=#{sex},email=#{email} WHERE id=#{id}")
    public void update(Student student);

    @Delete("DELETE FROM student WHERE id=#{id}")
    public void delete(Integer id) ;

    @Select("SELECT * FROM student WHERE id=#{id}")
    public Student getById(Integer id);

    @Select("SELECT * FROM student ")
    public List<Student> getAll();



}
